from pynput import mouse

# 当鼠标点击时调用的函数
def on_click(x, y, button, pressed):
    if pressed:
        print(f"鼠标左键点击位置：x={x}, y={y}")

# 创建鼠标监听器
listener = mouse.Listener(on_click=on_click)

# 启动监听器
listener.start()

# 等待监听器线程结束
listener.join()
